<?php

command('spider:worker', '启动爬虫 worker', function ()
{
    $config_key = command_paramater('config_key', 'default');
    $memory_limit = command_paramater('memory_limit', 1048576 * 128);

    ini_set('memory_limit', $memory_limit.'b');

    spider_finish_action(function () {
    });

    spider_watch($config_key, $memory_limit);
});

command('spider:trigger', '爬虫时间触发', function ()
{
    spider_trigger();
});

command('spider:status', '爬虫任务状态', function ()
{/*{{{*/
    echo queue_status(SPIDER_POOL_TUBE, 'spider');
});/*}}}*/
